﻿﻿using System;
using System.Collections.Generic;
using System.Text;
namespace WebApplication1.DDD.Models.Entity.Common
{
    public class sys_config:NFinal.Struct
    {
		public System.Int64 id;
		public System.String name;
		public System.String info;
		public System.String value;
		#region 从get列表初始化实体类
		public static bool TryParse(NFinal.NameValueCollection get,out sys_config par)
		{
			par=new sys_config();
			try
			{
						System.Int64.TryParse(get["id"],out par.id);
						par.name=get["name"];
						par.info=get["info"];
						par.value=get["value"];
			}
			catch
			{
				return false;
			}
			return true;
		}
		#endregion
		#region 写Json字符串
		public override void WriteJson(System.IO.TextWriter tw)
		{
			tw.Write("{");
					tw.Write("\"id\":");
					tw.Write(id.ToString());
					tw.Write(",");
					tw.Write("\"name\":");
					tw.Write("\"");
					tw.Write(name==null?"null":name);
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"info\":");
					tw.Write("\"");
					tw.Write(info==null?"null":info);
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"value\":");
					tw.Write("\"");
					tw.Write(value==null?"null":value);
					tw.Write("\"");
			tw.Write("}");
		}
		#endregion
    }
}
